package com.brainhealth.customer.service.impl;

import java.util.List;
import com.brainhealth.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.brainhealth.customer.mapper.RoomUserPropertyMapper;
import com.brainhealth.customer.domain.RoomUserProperty;
import com.brainhealth.customer.service.IRoomUserPropertyService;

/**
 * 用户道具Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-02
 */
@Service
public class RoomUserPropertyServiceImpl implements IRoomUserPropertyService 
{
    @Autowired
    private RoomUserPropertyMapper roomUserPropertyMapper;

    /**
     * 查询用户道具
     * 
     * @param id 用户道具主键
     * @return 用户道具
     */
    @Override
    public RoomUserProperty selectRoomUserPropertyById(Long id)
    {
        return roomUserPropertyMapper.selectRoomUserPropertyById(id);
    }

    @Override
    public Integer getMaxPropertyId() {
        return roomUserPropertyMapper.getMaxPropertyId();
    }

    /**
     * 查询用户道具列表
     * 
     * @param roomUserProperty 用户道具
     * @return 用户道具
     */
    @Override
    public List<RoomUserProperty> selectRoomUserPropertyList(RoomUserProperty roomUserProperty)
    {
        return roomUserPropertyMapper.selectRoomUserPropertyList(roomUserProperty);
    }

    @Override
    public List<RoomUserProperty> getRoomUserPropertyList(RoomUserProperty roomUserProperty) {
        return roomUserPropertyMapper.getRoomUserPropertyList(roomUserProperty);
    }

    @Override
    public RoomUserProperty getRoomUserProperty(RoomUserProperty roomUserProperty) {
        return roomUserPropertyMapper.getRoomUserProperty(roomUserProperty);
    }

    /**
     * 新增用户道具
     * 
     * @param roomUserProperty 用户道具
     * @return 结果
     */
    @Override
    public int insertRoomUserProperty(RoomUserProperty roomUserProperty)
    {
        roomUserProperty.setCreateTime(DateUtils.getNowDate());
        return roomUserPropertyMapper.insertRoomUserProperty(roomUserProperty);
    }

    /**
     * 修改用户道具
     * 
     * @param roomUserProperty 用户道具
     * @return 结果
     */
    @Override
    public int updateRoomUserProperty(RoomUserProperty roomUserProperty)
    {
        roomUserProperty.setUpdateTime(DateUtils.getNowDate());
        return roomUserPropertyMapper.updateRoomUserProperty(roomUserProperty);
    }

    @Override
    public int updateUserProperty(RoomUserProperty roomUserProperty) {
        roomUserProperty.setUpdateTime(DateUtils.getNowDate());
        return roomUserPropertyMapper.updateUserProperty(roomUserProperty);
    }

    @Override
    public int updateRoomUserPropertyByPropertyId(RoomUserProperty roomUserProperty) {
        return roomUserPropertyMapper.updateRoomUserPropertyByPropertyId(roomUserProperty);
    }

    @Override
    public int resetProperty(RoomUserProperty roomUserProperty) {
        roomUserProperty.setUpdateTime(DateUtils.getNowDate());
        return roomUserPropertyMapper.resetProperty(roomUserProperty);
    }

    /**
     * 批量删除用户道具
     * 
     * @param ids 需要删除的用户道具主键
     * @return 结果
     */
    @Override
    public int deleteRoomUserPropertyByIds(Long[] ids)
    {
        return roomUserPropertyMapper.deleteRoomUserPropertyByIds(ids);
    }

    /**
     * 删除用户道具信息
     * 
     * @param id 用户道具主键
     * @return 结果
     */
    @Override
    public int deleteRoomUserPropertyById(Long id)
    {
        return roomUserPropertyMapper.deleteRoomUserPropertyById(id);
    }
}
